package com.xbongbong.paas.enums;

import lombok.Getter;

/**
 * @author: wufeng
 * @date: 2018/10/11 10:43
 * @desrcption: 关联数据主键字段允许选择的字段
 */
@Getter
public enum LinkKeyExplainEnum {

    /**
     * 关联数据主键字段允许选择的字段
     */
    TEXT(FieldTypeEnum.TEXT),
    TEXTAREA(FieldTypeEnum.TEXTAREA),
    NUM(FieldTypeEnum.NUM),
    COMBO(FieldTypeEnum.COMBO),
//    DATETIME(FieldTypeEnum.DATETIME),
    RADIO_GROUP(FieldTypeEnum.RADIO_GROUP),
//    USER(FieldTypeEnum.USER),
//    DEPT(FieldTypeEnum.DEPT),
    SERIALNO(FieldTypeEnum.SERIALNO),
    STAGE_THRUSTER(FieldTypeEnum.STAGE_THRUSTER),


    ;

    private FieldTypeEnum fieldTypeEnum;

    LinkKeyExplainEnum(FieldTypeEnum fieldTypeEnum){
        this.fieldTypeEnum = fieldTypeEnum;
    }

    public static LinkKeyExplainEnum getFieldTypeEnum(Integer type) {
        for (LinkKeyExplainEnum e: values()) {
            if(type.equals(e.getFieldTypeEnum().getType())){
                return e;
            }
        }
        return null;
    }

}
